<?php
namespace Mp\Middleware;

use Closure;
use Illuminate\Support\Facades\Route;
use Spatie\Permission\Models\Permission as SPermission;
use Mp\Auth\Permission as Checker;

class Permission{

	public function handle($request,Closure $next){
		$route_name = Route::currentRouteName();
		if(!Checker::check($route_name)){
			 Checker::error();
		}
		return $next($request);
	}
}